import http from "@/utils/request";

//分类列表
function artCateListRequest(per,page) {
  return http({
    method:'get',
    url:'/api/v1/admin/articlecategory',
    params:{per,page}
  })
}

//分类新增
function artCateAddRequest(name, desc, coverImage, parent) {
  return http({
    method:'post',
    url:'/api/v1/admin/articlecategory',
    data:{
      name, 
      desc,
      coverImage,
      parent
    }
  })
}

//分类修改
function artCateUpdateRequest(id,name, desc, coverImage, parent) {
  return http({
    method:'put',
    url:`/api/v1/admin/articlecategory/${id}`,
    data:{
      id,
      name, 
      desc,
      coverImage,
      parent
    }
  })
}

//分类删除
function artCateDeleteRequest(id) {
  return http({
    method:'delete',
    url:`/api/v1/admin/articlecategory/${id}`,
    params:{
      id
    }
  })
}


export { artCateListRequest,artCateAddRequest,artCateUpdateRequest,artCateDeleteRequest };